package com.yujistu.fragment.appointfragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.RelativeLayout;

import com.yujistu.R;
import com.yujistu.activity.ClassDearsActivity;
import com.yujistu.adapter.BaseListAdapter;
import com.yujistu.adapter.GroupDetailAdapter;
import com.yujistu.fragment.BaseFragment;

/**
 * Created by Win on 2015/11/6.
 */
public class GroupDetailFragment extends BaseFragment {

    public RelativeLayout mHeader;

    private View mContentView;

    public GroupDetailAdapter mAdapter = null;
    public ListView mListViewDetail;

    @Override
    public void initView(View view) {
    }

    @Override
    public BaseListAdapter getListAdapter() {
        return null;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        mContentView = inflater.inflate (R.layout.fragment_group_detail_venues, container, false);

        initListView();
        return mContentView;
    }

    private void initListView() {
        mHeader = (RelativeLayout)mContentView.findViewById(R.id.listDetaRL);
        mListViewDetail= (ListView)mContentView.findViewById(R.id.listView);
        mListViewDetail.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                  startActivity(new Intent(getActivity(), ClassDearsActivity.class));
            }
        });

        mAdapter = new GroupDetailAdapter(getActivity());
        mListViewDetail.setAdapter(mAdapter);
    }
}
